package com.powernode.bank.dao.impl;

import com.powernode.bank.dao.AccountDao;
import com.powernode.bank.pojo.Account;
import com.powernode.bank.util.sqlSessionUtil;
import org.apache.ibatis.session.SqlSession;

public class AccountDaoImpl implements AccountDao {
    public Account selectByActno(String actno) {
        SqlSession sqlSession = sqlSessionUtil.openSession();
        Account account = sqlSession.selectOne("account.selectByActno", actno);
        return account;
    }

    public int updateBalance(Account account) {
        SqlSession sqlSession = sqlSessionUtil.openSession();
        int update = sqlSession.update("account.updateByAccount", account);

        return update;
    }
}
